package com.example.administrator.basedemos.dagger2.moudle;

import java.util.concurrent.TimeUnit;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;

/**
 * 创建者     ZCL
 * 创建时间   2018/3/26 14:43
 * 描述	      ${application模块}
 * <p>
 * 更新者     $Author$
 * 更新时间   $Date$
 * 更新描述   ${TODO}
 */
@Module
public class AppModule {

    @Singleton
    @Provides
    public OkHttpClient provideOkHttpClient (){
        OkHttpClient client = new OkHttpClient.Builder()
                .writeTimeout(3000, TimeUnit.MILLISECONDS)
                .readTimeout(3000, TimeUnit.MILLISECONDS)
                .connectTimeout(3000, TimeUnit.MILLISECONDS)
                .build();
        return client;
    }
}
